/**
 * Copyright (c) 2020 libinbin000
 * SFrame is licensed under the Mulan PSL v1.
 * You can use this software according to the terms and conditions of the Mulan PSL v1.
 * You may obtain a copy of Mulan PSL v1 at:
 *     http://license.coscl.org.cn/MulanPSL
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
 * See the Mulan PSL v1 for more details.
 */

import {DB} from './core/db/DB';
import {Log} from './core/log/Log';
import { PlayerData } from './game/PlayerData';
import {WSServer} from './game/WSServer';

export class Main{

    constructor(){
        console.log("服务器启动")
        //初始化日志
        Log.init();

        //初始未监控

        //处理全局错误

        //Redis初始化

        //数据库初始化
        DB.init();

        //注册协议
        require("./game/handle/LoginHandle");
        require("./game/handle/TestHandle");

        let a = new PlayerData
        a.load(1, ()=>{
            
        })
        //ws 服务
        let server = new WSServer();
        server.run(8000);
    }
}

new Main();